import processing.opengl.*;
import jocode.*;

JOApp joApp;    
int currX;

void setup() {
  size(640, 480, OPENGL);
  joApp = JOBridgeP5.init(this);

  noStroke();
}

void draw() {
  background(0);

  JOApp.begin();
  {
    // draw the default JOApp rendering
    joApp.draw();
  }
  JOApp.end();

  // draw a square moving along the top of the window
  fill(178, 128, 0);
  rect(width-currX, height-50, 50, 50);

  // draw a square moving along the bottom of the window
  fill(0, 128, 255);
  rect(currX, 0, 50, 50);

  currX = (int)(currX + width / frameRate)%width;
}



